import { Unitl } from "../Unitl";
Unitl.PrintStartTime();

Unitl.PrintOpeationName("函数重载");

function Hello(str:string):string;
function Hello(int:number):string;
function Hello(boo:boolean):String;
function Hello(anys:string|number|any):string{
    if(typeof(anys) === "string"){

        return "String";
    }else if( typeof anys === "number"){
        return "Number";
    }
    return "Failed!";
};
console.log(Hello("1s3"));
console.log(Hello(666));
console.log(Hello(true));


/*
    TS的函数重载是函数如载啊，重载可能还要自己实现！
*/ 


Unitl.PrintOpeationName("接口继承");
interface IA{
    prop_1:string;
    prop_2:number;
};

interface IB extends IA{
    prop_3:boolean;
};

const obj :IB = {
    prop_3: false,
    prop_1: "asd",
    prop_2: 55
};
console.log(obj.prop_1);
console.log(obj.prop_2);
console.log(obj.prop_3);